<template>
  <div>
    <input type="text" @keyup.enter="onEnter" />
  </div>
</template>

<script>
export default {
  methods: {
    onEnter(e) {
      let value = e.target.value
      e.target.value = ''
      this.$emit('addTodo', { id: Date.now(), value, done: false })
    }
  }
}
</script>

<style lang="scss" scoped></style>
